package org.linlinjava.litemall.db.service;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.linlinjava.litemall.db.dao.LitemallRewardLogMapper;
import org.linlinjava.litemall.db.domain.LitemallRewardLog;
import org.springframework.stereotype.Service;

@Service
public class LitemallRewardLogService extends MPJBaseServiceImpl<LitemallRewardLogMapper, LitemallRewardLog> {
    public Integer getPromoteNum(Integer userId) {
       return baseMapper.selectCount(Wrappers.lambdaQuery(LitemallRewardLog.class)
                .eq(LitemallRewardLog::getUserId, userId)).intValue();
    }
}
